#include<bits/stdc++.h>

using namespace std;

int main(){
	int n;scanf("%d", &n);
	int a[n],b[n];
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &a[i]);
	}
	for (int i = 1; i < n-1; ++i)
	{
		b[i]=(a[i-1]+a[i]+a[i+1])/3;
	}
	b[0]=(a[0]+a[1])/2; b[n-1]=(a[n-1]+a[n-2])/2;
	for (int i = 0; i < n; ++i)
	{
		printf("%d%c", b[i],i==n-1?'\n':' ');
	}
	
	return 0;
}